home *** CD-ROM | disk | FTP | other *** search
- unit uicon;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ComCtrls, StdCtrls;
-
- type
- TForm1 = class(TForm)
- ListView1: TListView;
- ImageList1: TImageList;
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- const
- IconNames: array [0..28] of PChar = (
- 'MainIcon', 'MainIconDCU',
- 'MainIconDFM', 'MainIconDPK',
- 'MainIconDPR', 'MainIconPAS',
- 'NewActiveX', 'NewApp',
- 'NewComp', 'NewData',
- 'NewDLL', 'NewForm',
- 'NewPackage', 'NewRemoteData',
- 'NewText', 'NewThread',
- 'NewUnit', 'Project',
- 'ProjectIcon', 'RepBothForm',
- 'RepMainForm', 'RepNewForm',
- 'RepNewProject', 'XAuto',
- 'XCtrl', 'XForm',
- 'XLib', 'XProp',
- 'XTLib' );
-
- procedure TForm1.FormCreate(Sender: TObject);
- var
- Idx: integer;
- hLib: hModule;
-
- procedure AddIcon (IconName: PChar);
- var
- Icon: TIcon;
- Idx: Integer;
- ListItem: TListItem;
- begin
- Icon := TIcon.Create;
- try
- Icon.Handle := LoadIcon (hLib, IconName);
- Idx := ImageList1.AddIcon (Icon);
- ListItem := ListView1.Items.Add;
- ListItem.Caption := IconName;
- ListItem.ImageIndex := Idx;
- finally
- Icon.Free;
- end;
- end;
-
- begin
- hLib := LoadLibrary ('c:\delphi 3.0\bin\delphi32.exe');
- if hLib <> 0 then try
- for Idx := Low(IconNames) to High(IconNames) do
- AddIcon (IconNames [Idx]);
- finally
- FreeLibrary (hLib);
- end;
- end;
-
- end.
-
-
-